<include file='Public:head'/>
<body class="J_scroll_fixed">
<style>
    .pop_nav {
        padding: 0px;
    }


</style>
<link rel="stylesheet" type="text/css" href="__ORG__/webuploader/webuploader.css">
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="__ORG__/webuploader/webuploader.min.js"></script>

<div class="wrap J_check_wrap">
    <div class="nav">
        <ul class="cc">
            <if condition='$cat["cat_type"] eq 4'>
                <li class="current"><a href="javascirpt:;">{$cat.cname}添加文档</a></li>
                <else/>
                <li><a href="{:U('Article/index',array('category_cid'=>$_GET[" category_cid"],'verifystate'=>2))}">{$cat.cname}列表</a>
                </li>
                <li class="current"><a href="javascrip:;">添加文档</a></li>
            </if>

        </ul>
    </div>
    <div class="pop_nav">
        <ul class="J_tabs_nav">
            <li class="current"><a href="javascript:;">基本属性</a></li>
            <li class=""><a href="javascript:;">图集</a></li>
            <li class=""><a href="javascript:;">其他设置</a></li>
        </ul>
    </div>
    <form class="J_ajaxForms" name="myform" id="myform" action="{:U('Article/add')}" method="post">
        <div class="J_tabs_contents  layui-form">
            <div>
                <div class="h_a">基本属性</div>
                <div class="">


                    <table width="100%" class="layui-table ">
                        <tr>
                            <th width="200">所属栏目：</th>
                            <td>
                                <div class="layui-input-inline">
                                    <select name="category_cid" class="">
                                        <option value="{$topCat.cid}">{$topCat.cname}</option>
                                        <foreach name='topChild' item='v'>
                                            <option value="{$v.cid}" <if condition="$_GET['category_cid'] eq $v['cid']"> selected='selected'</if>>--{$v._html}{$v.cname}</option>
                                        </foreach>
                                    </select>
                                </div>

                            </td>
                        </tr>


                        <tr>
                            <th>标题：</th>
                            <td><span class="must_red">*</span><input type="text" name="article_title"
                                                                      id="article_title" class="layui-input input"
                                                                      value="" style='width:50%'></td>
                        </tr>
                        <tr>
                            <th>(英)标题：</th>
                            <td><input type="text" name="article_title_en" id="article_title_en" class="layui-input"
                                       value="" style='width:50%'></td>
                        </tr>

                        <tr>
                            <th><strong>META Keywords(关键词)</strong><br/>
                                关键字中间用半角逗号隔开
                            </th>
                            <td><textarea name='keywords' id='keywords' style="width:90%;height:80px"
                                          class="layui-input"></textarea></td>
                        </tr>
                        <if condition='C("cfg_language_en")'>
                            <tr>
                                <th>(英)<strong>META Keywords(关键词)</strong><br/>
                                    关键字中间用半角逗号隔开
                                </th>
                                <td><textarea name='keywords_en' id='keywords_en' style="width:90%;height:80px"
                                              class="layui-input"></textarea></td>
                            </tr>
                        </if>
                        <tr>
                            <th><strong>META Description(描述)</strong><br/>
                                针对搜索引擎设置的网页描述
                            </th>
                            <td><textarea name='description' id='description' style="width:90%;height:80px"
                                          class="layui-input"></textarea></td>
                        </tr>
                        <if condition='C("cfg_language_en")'>
                            <tr>
                                <th>(英)<strong>META Description(描述)</strong><br/>
                                    针对搜索引擎设置的网页描述
                                </th>
                                <td><textarea name='description_en' id='description_en' style="width:90%;height:80px"
                                              class="layui-input"></textarea></td>
                            </tr>
                        </if>
                        <tr>
                            <th>显示排序：</th>
                            <td><input type="text" name="sort" id="sort" class="layui-input" value="100"></td>
                        </tr>
                        <tr>
                            <th>浏览次数：</th>
                            <td><input type="text" name="click" id="click" class="layui-input" value="900"></td>
                        </tr>
                        <tr>
                            <th>发布时间：</th>
                            <td><input type="text" name="addtime" id="laytime" class="layui-input "
                                       value="<?php echo format_date(time(),0);?>"></td>
                        </tr>
                        <tr>
                            <th>文档属性：</th>
                            <td>
                                <foreach name='Think.Config.flag' item='v'>
                                    <div class="layui-unselect layui-form-checkbox">
                                        <input type="checkbox" value="{$v}" name="flag[]" lay-skin="primary"
                                               title='{$v}'>
                                    </div>
                                </foreach>

                            </td>
                        </tr>
                        <tr>
                            <th>状态：</th>
                            <td>
                                <input type="radio" name="verifystate" value="1" title="未审核">
                                <input type="radio" name="verifystate" value="2" title="通过" checked="">
                            </td>
                        </tr>


                        <tr>
                            <th>缩略图：</th>
                            <td>
                                <div class="pics_box">
                                    <div class="pics">
                                        <ul class="feng-form-item-photo">
                                            <input type="hidden" name="pic" value="{$data.pic}" class="n"/>
                                            <li class="upload-btn pic_upload" data-name="pic"/>
                                            <i class="layui-icon layui-icon-upload"></i>上传图片
                                            </li>
                                        </ul>
                                    </div>
                                </div>
                            </td>
                        </tr>


                        <tr>
                            <th>文件：</th>
                            <td>
                                <div class="file_box">

                                    <input type="text" name="file_name" id="f-picker" value="" size="50"
                                           class="layui-input"/>
                                    <div type="button" class="layui-btn" id="picker">上传文件</div>
                                    <br><br>
                                    <div id="thelist-picker" class="uploader-list"></div>
                                    <script>{$upload}</script>
                                </div>
                            </td>
                        </tr>


                        <volist name='extForm' id='value'>
                            <tr>
                                <th>{$value.title}：</th>
                                <td>{$value.html}</td>
                            </tr>
                        </volist>
                    </table>
                    <if condition='$attrForm'>

                        <div class="h_a">筛选</div>
                        <table width="100%" class="table_form ">
                            <volist name='attrForm' id='value'>
                                <tr>
                                    <th width="160">{$value.title}：</th>
                                    <td>{$value.html}</td>
                                </tr>
                            </volist>
                        </table>
                    </if>
                </div>
            </div>


            <div style="display:none">
                <div class="h_a">图集</div>
                <div class="table_full">

                    <table width="100%" class="table_form ">

                        <tr>
                            <td>
                                <div class="layui-upload pics_box">
                                    <button type="button" class="layui-btn pics_upload" data-name="pics[]">多图片上传
                                    </button>
                                    <blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
                                        预览图：
                                        <div class="layui-upload-list feng-form-item-photo pics">
                                            <ul class="feng-form-item-photo">

                                                <li style="width: 0;height:0" class="d"></li>

                                            </ul>
                                        </div>
                                    </blockquote>
                                </div>
                            </td>
                        </tr>


                    </table>
                </div>
            </div>

            <div style="display:none">
                <div class="h_a">其他设置</div>
                <div class="table_full">
                    <table width="100%" class="table_form ">
                        <tr>
                            <th width="160">自定义文件：</th>
                            <td><input type="text" name="file_url" id="file_url" class="layui-input" value=""
                                       style="width:60%"></td>
                        </tr>
                        <tr>
                            <th>跳转地址：</th>
                            <td><input type="text" name="jump_url" id="jump_url" class="layui-input" value=""
                                       style="width:60%"></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>

        <div class="btn_wrap">
            <div class="btn_wrap_pd">
                <input type="hidden" name="isattr" value="0"/>
                <button class="layui-btn " type="submit">提交</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
    var articleValidate = '{{$validate}}';
    var controller = '{$Think.const.CONTROLLER_NAME}';
    var imgextsion = '{$Think.Config.cfg_image}';

</script>
<script src="__ROOT__/lib/layuiadmin/layui/layui.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/mod.common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/mod.content_addtop.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/mod.article.js"></script>

<script type="text/html" id="J_PhotoTpl">
    <li>
        <div class="img"><img src="__ROOT__/{{ d.file }}"/></div>
        <input type="hidden" name="{{ d.name }}" value="{{ d.file }}"/>
        <textarea name="{{d.title}}" value="{{d.title}}"></textarea>
        <i class="layui-icon layui-icon-delete feng-photo-delete" title="删除图片" data-path="{{ d.file }}">
            <a href="__ROOT__/index.php/Admin/Upload/del/id/{{ d.id }}.html"></a>
        </i>
    </li>
</script>
<style>
    .feng-form-item-photo li {
        float: none;
        width: auto;
        height: auto;
        overflow: hidden;
    }

    .feng-form-item-photo li textarea {
        width: 400px;
        height: 100px;
        float: left;
        border: 1px solid #eee;
        padding: 10px;
    }

    .feng-form-item-photo li .img {
        float: left;
    }

    .feng-form-item-photo li .layui-icon-delete {
        bottom: 0;
        left: 0;
        right: auto;
    }
</style>

</body>
</html>